package com.example.mahoutdemo.core.customer.commodity.operation;

import lombok.Data;
import lombok.experimental.Accessors;

import org.springframework.beans.BeanUtils;
import java.time.LocalDateTime;
/**
 *null
 */
@Data
@Accessors(chain = true)
public class CustomerCommodityOperationDto {

    /**
     * 唯一标识
     */
    private Long id;
    /**
     * 用户id
     */
    private Long customerId;
    /**
     * 商品id
     */
    private Long commodityId;
    /**
     * 操作类型
     */
    private Integer operationType;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    public static CustomerCommodityOperationDto getInstance(CustomerCommodityOperation source){
        CustomerCommodityOperationDto target = new CustomerCommodityOperationDto();
        BeanUtils.copyProperties(source,target);
        return target;
     }

    public CustomerCommodityOperation convert(){
        CustomerCommodityOperation target = new CustomerCommodityOperation();
        BeanUtils.copyProperties(this,target);
        return target;
    }
}
